#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
  // 数组元素的反转
  int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int len = sizeof(arr) / sizeof(int);
  int tmp;
  /* for (int i = 0; i < len / 2; i++) {
    tmp = arr[i];
    arr[i] = arr[len - i - 1];
    arr[len - i - 1] = tmp;
  } */
  /* int i = 0;
  while (i < len / 2) {
    tmp = arr[i];
    arr[i] = arr[len - i - 1];
    arr[len - i - 1] = tmp;
    i++;
  } */
  int i = 0;
  int j = len - i - 1;
  while (i < j) {
    tmp = arr[i];
    arr[i] = arr[j];
    arr[j] = tmp;
    i++;
    j--;
  }
  // 遍历数组
  for (int i = 0; i < len; i++) {
    printf("%d\t", arr[i]);
  }
  return EXIT_SUCCESS;
}
